package com.aabte.design.pattern.behavioral.templatemethod;

public abstract class AbstractCourse {

    protected final void makeCousre(){

        makePPT();
        makeVideo();
        if (needWriteArticle()) {
            this.writeArticle();
        }
        packageCourse();

    }

    final void makePPT(){
        System.out.println("制作PPT");

    }

    final void makeVideo(){
        System.out.println("制作视频");
    }

    final void writeArticle(){
        System.out.println("制作手记");
    }

    /**
     * 钩子方法，不能使用final修饰
     */
    boolean needWriteArticle(){
        return false;
    }

    abstract void packageCourse();

}
